Skip to main content

Sessions

Not available for all users. Contact [email protected] for more information about this endpoint.

Base URL

All following endpoints operate over the URL of your store: https://your-store.com

Example: https://example.publica.la

Endpoints
Retrieve

Headers

{
"Content-Type": "application/json",
"Accept": "application/json",
"X-User-Token": "api_token"
}
info

Make sure you generated the api_token on your store. More info HERE

Retrieve

GET /integration-api/v1/consumption/sessions

Query Parameters

ParameterTypeExample
cursorstring/integration-api/v1/consumption/sessions?cursor=eyJzdGF....J1ZX0
issue_idinteger/integration-api/v1/consumption/sessions?issue_id=1125899910000160
user_idinteger/integration-api/v1/consumption/sessions?user_id=1125899911002602
reason_typestring/integration-api/v1/consumption/sessions?reason_type=free_issue
reason_valueinteger/integration-api/v1/consumption/sessions?reason_type=subscription_with_collectionsreason_value=3357
from_datestring/integration-api/v1/consumption/sessions?from_date=2022-09-21&to_date=2022-09-23
to_datestring/integration-api/v1/consumption/sessions?to_date=2022-09-23&to_date=2022-09-23
tip

Query parameters can be combined to achieve more specific filtering. All are optional, except the from_date and to_date fields which always go together, just as to send a reason_value you must specify reason_type.

tip

The cursor parameter can be used to paginate results.

Response

CodeDescription
200Success
403Feature disabled for your store
401Unauthenticated

Response Example

{
"CODE": "success",
"current_page": 1,
"data": [
{
"uuid": "151:8000005:9000886:1734446548",
"issue_id": 8000005,
"user_id": 9000886,
"volpe_host": "farfalla",
"reason_type": "assigned_issue",
"reason_value": null,
"seconds_reading": 125,
"started_at": "2024-12-17 14:42:28",
"page_changes": 12,
"last_heartbeat_at": null,
"user_email": "[email protected]"
}
],
"path": "https://example.publica.la/integration-api/v1/consumption/sessions",
"per_page": 25,
"next_cursor": "eyJzdGFydGVkX2F0IjoiMjAyNC0wOS0xOCAxNjoxMzoxMCIsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
"next_page_url": "https://example.publica.la/integration-api/v1/consumption/sessions?cursor=eyJzdGFydGVkX2F0IjoiMjAyNC0wOS0xOCAxNjoxMzoxMCIsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
"prev_cursor": null,
"prev_page_url": null
}

Response Fields

The response is paginated with up to 25 sessions per page. Each session includes the following fields:

FieldTypeDescription
uuidstringUnique identifier for the session, combining tenant_id, issue_id, user_id, and timestamp.
issue_idintegerID of the edition associated with the session.
user_idinteger/nullID of the user in the system. Null for guest.
user_emailstringEmail of the user.
volpe_hoststringPlatform where the session occurred. Possible values: farfalla, fenice, fenice_desktop.
reason_typestringReason the user accessed the content. Possible values are detailed below.
reason_valueinteger/nullAdditional data related to the reason, such as subscription plan ID for certain types.
started_atdatetimeTimestamp when the session started.
seconds_readingintegerDuration of the session in seconds.
page_changesintegerNumber of page changes during the session.
last_heartbeat_atdatetimeTimestamp of the last activity ping in the session.

Possible reason_type Values

ValueDescription
license_retailContent accessed through a retail license.
administrator_userContent accessed by an administrator.
free_issueContent accessed because it is free.
preview_issueContent preview access enabled.
free_accessContent accessed via integration with free access enabled.
bought_issueContent purchased by the user.
assigned_issueContent assigned manually by an administrator.
gifted_issueContent gifted to the user.
external_permissionsAccess through integration of reading permissions.
subscription_with_collectionsAccess through a subscription with content collections.
global_subscriptionAccess through a subscription granting global content access.
lti_and_entry_point_free_accessAccess through LTI integration.
saml_and_entry_point_free_accessAccess through SAML integration.

In cases where reason_type is subscription_with_collections or global_subscription, reason_value will contain the subscription plan ID.

info

The plan id can be found HERE